Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 0178fb0d4f822fe2172d117d001ef96f2ce226a7


Parents : 19d8909
Author : Mark Qvist <mark@unsigned.io>
Date : 2024-10-05T22:40:14+02:00

Don't reset propagation node address and links if already set to the same destination

Changes

1 files changed, 6 insertions(+), 5 deletions(-)


Diff

diff --git a/LXMF/LXMRouter.py b/LXMF/LXMRouter.py
index 4157741..7968854 100644
--- a/LXMF/LXMRouter.py
+++ b/LXMF/LXMRouter.py
@@ -284,11 +284,12 @@ class LXMRouter:
if len(destination_hash) != RNS.Identity.TRUNCATED_HASHLENGTH//8 or type(destination_hash) != bytes:
raise ValueError("Invalid destination hash for outbound propagation node")
else:
- self.outbound_propagation_node = destination_hash
- if self.outbound_propagation_link != None:
- if self.outbound_propagation_link.destination.hash != destination_hash:
- self.outbound_propagation_link.teardown()
- self.outbound_propagation_link = None
+ if self.outbound_propagation_node != destination_hash:
+ self.outbound_propagation_node = destination_hash
+ if self.outbound_propagation_link != None:
+ if self.outbound_propagation_link.destination.hash != destination_hash:
+ self.outbound_propagation_link.teardown()
+ self.outbound_propagation_link = None
def get_outbound_propagation_node(self):
return self.outbound_propagation_node


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────